package com.dinree.activity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

import com.base.library.BaseActivity;
import com.dinree.R;

public class WelcomeActivity extends BaseActivity {

    @Override
    public int getLayoutId() {
        return R.layout.activity_welcome;
    }

    @Override
    public void initData(Bundle savedInstanceState) {

    }

    private void checkToken() {
//        UserBean user = realm.findFirst(UserBean.class);
//        if (user != null) {
        Intent intent = new Intent(mContext, MainActivity.class);
        startActivity(intent);
//        } else {
//            Intent intent = new Intent(mContext, LoginActivity.class);
//            startActivity(intent);
//        }
        finish();
    }

    @Override
    protected void onResume() {
        super.onResume();
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                checkToken();
            }
        }, 500);
    }
}
